#pragma once
#include<vulkan/vulkan.hpp>
#include<array>
#include<glm/glm.hpp>
struct Vertex
{
public:
    /* data */
//    glm::vec2 pos;
//    glm::vec3 color;
    float pos[2];
    float color[3];
public:

    vk::VertexInputBindingDescription getBindDescription();
    /// @brief erhnerhk
    /// @return attr
    std::array<vk::VertexInputAttributeDescription,2> getAttrDescription();
};


 
inline vk::VertexInputBindingDescription Vertex::getBindDescription()
{
    vk::VertexInputBindingDescription result = {};
    result.setBinding(0)
    .setInputRate(vk::VertexInputRate::eVertex)
    .setStride(sizeof(Vertex));
    return result;
}

inline std::array<vk::VertexInputAttributeDescription,2> Vertex::getAttrDescription()
{
    std::array<vk::VertexInputAttributeDescription,2> result;
    result[0].setBinding(0)
    .setLocation(0)
    .setFormat(vk::Format::eR32G32Sfloat)
    .setOffset(offsetof(Vertex,pos));

    result[1].setBinding(0)
    .setLocation(1)
    .setFormat(vk::Format::eR32G32B32Sfloat)
    .setOffset(offsetof(Vertex,color));
    return result;
}
